package windbell.domain.risk.events;

import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import windbell.domain.risk.RiskCheckGenerator;
import windbell.domain.risk.RiskCheckTarget;
import windbell.domain.risk.events.RiskCheckGeneratorEventsListener;

@Service("windbell.domain.risk.events.RiskCheckGeneratorEventsManager")
public class RiskCheckGeneratorEventsManager extends EntityEventsManager<RiskCheckGenerator> {
  @Autowired(required = false)
  private Collection<RiskCheckGeneratorEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RiskCheckGeneratorEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireDelete(final RiskCheckGenerator entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RiskCheckGeneratorEventsListener)listener).delete(entity);
    }
    
  }
  
  public void fireAddCheckTarget(final RiskCheckGenerator entity, final RiskCheckTarget item) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RiskCheckGeneratorEventsListener)listener).addCheckTarget(entity,item);
    }
    
  }
  
  public void fireGenerateTask(final RiskCheckGenerator entity, final Date date) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RiskCheckGeneratorEventsListener)listener).generateTask(entity,date);
    }
    
  }
}
